package com.usian.admin.controller.v1;

import com.usian.admin.service.AdChannelService;
import com.usian.api.admin.AdChannelControllerApi;
import com.usian.model.admin.dtos.ChannelDto;
import com.usian.model.admin.pojos.AdChannel;
import com.usian.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2023 12 20 16 44
 **/
@RestController
@RequestMapping("/v1/adchannel")
@Api(value = "频道管理",tags="adchannel",description = "频道管理API")
public class AdChannelController implements AdChannelControllerApi {

    @Autowired
    AdChannelService adChannelService;
    @Override
    @PostMapping("/findAdChannel")
    @ApiOperation(value = "查询频道信息")
    public ResponseResult findAdChannel(@RequestBody ChannelDto channelDto) {
        return adChannelService.findAdChannel(channelDto);
    }

    @Override
    @PostMapping("/saveAdChannel")
    public ResponseResult saveAdChannel(@RequestBody AdChannel adChannel) {
        return adChannelService.insert(adChannel);
    }

    @Override
    @PostMapping("/updateAdchannel")
    public ResponseResult updateAdchannel(@RequestBody AdChannel adChannel) {
        return adChannelService.updateAdchannel(adChannel);
    }

    @Override
    @GetMapping("/delAdchannel")
    public ResponseResult delAdchannel(Integer id) {
        return adChannelService.delAdchannel(id);
    }


}
